<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * UserClient.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class UserMember extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_member', function (Blueprint $table) {
            $table->bigIncrements('id');//BigID unsigned
            $table->unsignedBigInteger('user_id');//用户ID
            $table->unsignedBigInteger('site_id');//所属站点ID

            $table->string('title', 8)->default('');// 头衔，如Dr. Mr.
            $table->string('gender', 8)->default('');// 性别，如female、male
            $table->string('first_name', 32)->default('');// 名字
            $table->string('middle_name', 32)->default('');// 中名
            $table->string('last_name', 32)->default('');// 姓氏
            $table->string('country', 12)->default('');// 所在国家
            $table->string('address', 255)->default('');// 联系地址
            $table->string('affiliation', 128)->default('');// 联系单位，附属单位
            $table->string('department', 128)->default('');// 职务、部门，所在部门
            $table->string('institution', 128)->default('');// 机构（单位）名称
            $table->string('fax_number', 32)->default('');// 传真号码
            $table->string('phone_number', 32)->default('');// 电话号码
            $table->string('mobile_number', 32)->default('');// 手机号码

            // 注意时间戳位数
            $table->timestamps();

            // index
            $table->index('user_id');
            $table->index('site_id');
            $table->index(['user_id', 'site_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_member');
    }
}